﻿@using EasyXaf.EntityDesigner.Editors.DetailViewEditors.Components

<div id="@EditorId" class="detail-view-editor d-flex">
    <div class="editor-toolbox d-flex">
        <DxTabs CssClass="d-flex flex-column xaf-flex-auto w-100" RenderMode="TabsRenderMode.AllTabs">
            <DxTabPage Text="组件" CssClass="h-100">
                <ComponentToolboxComponent CssClass="h-100 w-100" />
            </DxTabPage>
            <DxTabPage Text="实体" CssClass="h-100">
                <EntityTreeComponent CssClass="h-100 w-100 overflow-hidden" Entity="Model.View.Entity" />
            </DxTabPage>
        </DxTabs>
    </div>
    <div class="editor-container d-flex xaf-flex-auto">
        <DxTabs CssClass="d-flex flex-column xaf-flex-auto w-100">
            <DxTabPage Text="设计" CssClass="h-100">
                <LayoutDesignerComponent CssClass="h-100 w-100" LayoutDesigner="LayoutDesigner" LayoutChanged="OnLayoutChanged" />
            </DxTabPage>
            <DxTabPage Text="源码" CssClass="h-100">
                <LayoutSourceCodeComponent CssClass="h-100 w-100 overflow-hidden" SourceCode="@SourceCode" SourceCodeChanged="OnSourceCodeChanged" />
            </DxTabPage>
        </DxTabs>
    </div>
</div>

@code {
    public static RenderFragment Create(DetailViewEditorModel model)
    {
        return @<DetailViewEditorRenderer Model="model" />;
    }
}
